home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / OBJ1_2.ZIP;1 / C_MASK.TXT < prev    next >
Encoding:
Text File  |  1992-12-22  |  7.6 KB  |  196 lines

  1. '
  2. 'Class description:
  3. '
  4. !short:Mask class structure:
  5. Class Mask:
  6. ~~~~~~~~~~~
  7. The View class is appended with user defined window content. The window inside
  8. can be filed with screen generator output.
  9.  
  10. Common use:
  11. ~~~~~~~~~~~
  12. The best way is to study the demo program Demo3.prg.
  13.  
  14. Source code of the class is in C_Mask.prg.
  15.  
  16. !seealso: c_view.ngo:View c_dbrows.ngo:DBrowse c_task.ngo:Task c_report.ngo:Report c_finfo.ngo:FInfo c_menu.ngo:Menu c_dbf.ngo:Dbf c_color.ngo:Color ob_class.ngo:"Class hierarchy"
  17.  
  18. !short:~~~~~~~~~~~~~~~~~~~~~
  19. !short:create class Mask from View
  20. !short:  export:
  21. !short:  var Initialized  //false
  22. ^BMask:Initialized^N: read-only: logical
  23.   Used for speed optimizing in displaying a object of the class in method
  24.   Mask:VPaint().
  25.  
  26. !short:  var SayData      //{{Row,Col,Text},...}
  27. ^BMask:SayData^N: public: array
  28.   Array of the pieces of the text, it should be displayed to the window
  29.   on the Row,Col position. It is filled mainly by the method
  30.   Mask:AddSay(...).
  31.  
  32. !short:  var GetData      //{{Row,Col},...}
  33. ^BMask:GetData^N: public: array
  34.   Array of positions of the Get objects for the object of class Mask.
  35.   It is filled mainly by methods Mask:AddField(...), Mask:AddMemo(...)
  36.   or Mask:AddBlock(...).
  37.  
  38. !short:  method New=MaskNew              //o:New() --> self
  39. ^BMask:New()^N: public: return self
  40.   Object is filled with default values.
  41.  
  42. !short:  method CreateObj=MaskCreateObj  //o:CreateObj() --> new_object_of_this_class
  43. ^BMask:CreateObj^N:public: return new_self_of_this_class
  44.    Returns the new object of this class.
  45.  
  46. !short:  method Copy=MaskCopy            //o:Copy() --> self
  47. ^BMask:Copy()^N:public: return copy_of_self
  48.   Returns the copy of the common object of this class.
  49.  
  50. !short:  method AddSay=MaskAddSay        //o:AddSay(R,C,Text) --> true
  51. ^BMask:AddSay(R,C,Text)^N: public: return true
  52.   This window is appended by next Text for view in the R,C position relative
  53.   to window beginning (i.e. to the left upper window corner).
  54.  
  55.   Parameter description:
  56.   ~~~~~~~~~~~~~~~~~~~~~~~
  57.   ^UR^N: numeric: no default
  58.    Position of edited data (row) relative to left upper window corner.
  59.  
  60.   ^UC^N: numeric: no default
  61.    Position of edited data (column) relative to left upper window corner.
  62.  
  63.   ^UText^N: character: no default
  64.    The displayed text.
  65.  
  66. !short:  method AddBlock=MaskAddBlock    //o:AddBlock(R,C,cShortNm,cVarNm,bBlock,bDoGet,cPict,bWhen,bValid) --> true
  67. ^BMask:AddBlock(R,C,ShortName,VarName,Block,DoGet,Pict,When,Valid)^N:
  68.   public: return true
  69.   This object is appended with the next column (variable) defined by
  70.   the code block.
  71.  
  72.   Parameter description:
  73.   ~~~~~~~~~~~~~~~~~~~~~~
  74.   ^UR^N: numeric: no default
  75.    Position of edited data (row) relative to left upper window corner.
  76.  
  77.   ^UC^N: numeric: no default
  78.    Position of edited data (column) relative to left upper window corner.
  79.  
  80.   ^UShortName^N: character: default is ""
  81.    The column name used in Browse mode.
  82.  
  83.   ^UVarName^N: character: default je ShortName
  84.    Edited variable name, or the database field name saved as information
  85.    to clipper Get object, created in this method and saved to DoGet array.
  86.    The clipper get object should know the edited variable name.
  87.  
  88.   ^UBlock^N: code_block:  no default
  89.    The code block of get/set type, can be created by clipper functions
  90.    FieldBlock(), FieldWBlock(), MemVarBlock() or by your own piece
  91.    of code.
  92.  
  93.   ^UDoGet^N: code_block: default is the virtual_method_Browse:DoGet()
  94.    The code block which by the help of the Get object edits the variable
  95.    (database field), of the respective table column. For properly use,
  96.    you can study source code of method DBrowse:DoGet in file c_DBrowse.prg,
  97.    and static function SetUsers in c_Menu.prg.
  98.  
  99.   ^UPicture^N: character: default is ""
  100.    The display mask for the column display mode.
  101.  
  102.   ^UWhen^N: code_block: default is {||true}
  103.    The code block evaluated before the begining of the editation of this
  104.    column, if returns false no editation is processed. It enables to produce
  105.    the computed table columns or the read-only columns.
  106.  
  107.   ^UValid^N: code_block: default is {||true}
  108.    The code block evaluated after finishing of the current column editation
  109.    for its validation. (if returns true the new value is valid)
  110.  
  111. !short:  method AddMemo=MaskAddMemo      //o:AddMemo(R,C,cShortNm,cField,bWhen,bValid,nRowSize,nColSize) --> true
  112. ^BMask:AddMemo(R,C,cShortName,cField,bWhen,bValid,nRowSize,nColSize)^N:
  113.   public: return true
  114.   This object is appended with the next column, defined as memo field.
  115.  
  116.   Parameter description:
  117.   ~~~~~~~~~~~~~~~~~~~~~~
  118.   ^UR^N: numeric: no default
  119.    Position of edited data (row) relative to left upper window corner.
  120.  
  121.   ^UC^N: numeric: no default
  122.    Position of edited data (column) relative to left upper window corner.
  123.  
  124.   ^UShortName^N: character: default is ""
  125.    The column name used in Browse mode.
  126.  
  127.   ^UcField^N: character: no default
  128.    The full name of the memo field (field->name), if there is no prefix
  129.    it is accepted from instvar variable View:Alias.
  130.  
  131.   ^UWhen^N: code_block: default is {||true}
  132.    The code block evaluated before the begining of the editation of this
  133.    column, if returns false no editation is processed. It enables to produce
  134.    the computed table columns or the read-only columns.
  135.  
  136.   ^UValid^N: code_block: default is {||true}
  137.    The code block evaluated after finishing of the current column editation
  138.    for its validation. (if returns true the new value is valid)
  139.  
  140.   ^UnRowSize^N: numeric: default is MaxRow()/3
  141.    MemoEdit window height in number of rows.
  142.  
  143.   ^UnColSize^N: numeric: default is MaxCol()/2
  144.    MemoEdit window width in number of columns.
  145.  
  146. !short:  method AddField=MaskAddField    //o:AddField(R,C,cShortNm,cField,cPicture,bWhen,bValid) --> true
  147. ^BMask:AddField(R,C,ShortName,Field,Picture,When,Valid)^N:
  148.   public: return true
  149.   The object is appended with the column defined as normal database field.
  150.  
  151.   Parameter description:
  152.   ~~~~~~~~~~~~~~~~~~~~~~
  153.   ^UR^N: numeric: no default
  154.    Position of edited data (row) relative to left upper window corner.
  155.  
  156.   ^UC^N: numeric: no default
  157.    Position of edited data (column) relative to left upper window corner.
  158.  
  159.   ^UShortName^N: character: default is ""
  160.    The column name used in Browse mode.
  161.  
  162.   ^UcField^N: character: no default
  163.    The full name of the memo field (field->name), if there is no prefix
  164.    it is accepted from instvar variable View:Alias.
  165.  
  166.   ^UcPicture^N: character: default is ""
  167.    The display mask for the column display mode.
  168.  
  169.   ^UWhen^N: code_block: default is {||true}
  170.    The code block evaluated before the begining of the editation of this
  171.    column, if returns false no editation is processed. It enables to produce
  172.    the computed table columns or the read-only columns.
  173.  
  174.   ^UValid^N: code_block: default is {||true}
  175.    The code block evaluated after finishing of the current column editation
  176.    for its validation. (if returns true the new value is valid)
  177.  
  178.   ^UnRowSize^N: numeric: default is MaxRow()/3
  179.    MemoEdit window height in number of rows.
  180.  
  181.   ^UnColSize^N: numeric: default is MaxCol()/2
  182.    MemoEdit window width in number of columns.
  183.  
  184. !short:  method PostInit=MaskPostInit    //o:PostInit() --> true
  185. ^BMask:PostInit()^N: public: return true
  186.   Modifies the implicitly herited initalisation data, because the Mask window
  187.   can't change its size.
  188.  
  189. !short:  method MaskPaint=MaskMaskPaint  //o:MaskPaint() --> true
  190. ^BMask:MaskPaint()^N: public: return true
  191.   The window content is painted if the variable Mask:FormActive==true.
  192.   Otherwise is the parent method VPaint() used.
  193.  
  194. !short:  endclass
  195.  
  196.